#include <stdio.h>

int add(int x, int y)
{
	int z;
	
	z = x + y;
	return z;
}

int main(void)
{
	int a = 5, b = 6;

	add(a, b);
	return 0;
}

#if 0

/*
 * intel
 */
0000000000001129 <add>:
    1129:	f3 0f 1e fa          	endbr64 
    112d:	55                   	push   %rbp
    112e:	48 89 e5             	mov    %rsp,%rbp
    1131:	89 7d ec             	mov    %edi,-0x14(%rbp)	// (rbp-x014)=edi
    1134:	89 75 e8             	mov    %esi,-0x18(%rbp)	// (rbp-0x18)=esi
    1137:	8b 55 ec             	mov    -0x14(%rbp),%edx	// edx=(rbp-0x14)
    113a:	8b 45 e8             	mov    -0x18(%rbp),%eax	// eax=(rbp-0x18)
    113d:	01 d0                	add    %edx,%eax	// eax+=edx
    113f:	89 45 fc             	mov    %eax,-0x4(%rbp)	// rbp-0x4=eax
    1142:	8b 45 fc             	mov    -0x4(%rbp),%eax	// eax=(rbp-x04)
    1145:	5d                   	pop    %rbp
    1146:	c3                   	retq   

0000000000001147 <main>:
    1147:	f3 0f 1e fa          	endbr64 
    114b:	55                   	push   %rbp
    114c:	48 89 e5             	mov    %rsp,%rbp
    114f:	48 83 ec 10          	sub    $0x10,%rsp
    1153:	c7 45 f8 05 00 00 00 	movl   $0x5,-0x8(%rbp)	// (rbp-0x8)=0x5
    115a:	c7 45 fc 06 00 00 00 	movl   $0x6,-0x4(%rbp)	// (rpb-0x4)=0x6
    1161:	8b 55 fc             	mov    -0x4(%rbp),%edx	// edx=(rbp-0x4)
    1164:	8b 45 f8             	mov    -0x8(%rbp),%eax	// eax=(rbp-0x8)
    1167:	89 d6                	mov    %edx,%esi	// esi=edx
    1169:	89 c7                	mov    %eax,%edi	// edi=eax
    116b:	e8 b9 ff ff ff       	callq  1129 <add>	// add(edi, esi)
    1170:	b8 00 00 00 00       	mov    $0x0,%eax
    1175:	c9                   	leaveq 
    1176:	c3                   	retq   
    1177:	66 0f 1f 84 00 00 00 	nopw   0x0(%rax,%rax,1)
    117e:	00 00 

/*
 * arm
 */
000000000040051c <add>:
  40051c:	d10083ff 	sub	sp, sp, #0x20
  400520:	b9000fe0 	str	w0, [sp, #12]	// [sp+12]=w0
  400524:	b9000be1 	str	w1, [sp, #8]	// [sp+8]=w1
  400528:	b9400fe1 	ldr	w1, [sp, #12]	// w1=[sp+12]
  40052c:	b9400be0 	ldr	w0, [sp, #8]	// w0=[sp+8]
  400530:	0b000020 	add	w0, w1, w0	// w0=w1+w0
  400534:	b9001fe0 	str	w0, [sp, #28]	// [sp+28]=w0
  400538:	b9401fe0 	ldr	w0, [sp, #28]	// w0=[sp+28]
  40053c:	910083ff 	add	sp, sp, #0x20	// sp=sp+0x20
  400540:	d65f03c0 	ret

0000000000400544 <main>:
  400544:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  400548:	910003fd 	mov	x29, sp
  40054c:	528000a0 	mov	w0, #0x5                   	// #5
  400550:	b9001fa0 	str	w0, [x29, #28]	// [x29+28]=5
  400554:	528000c0 	mov	w0, #0x6                   	// #6
  400558:	b9001ba0 	str	w0, [x29, #24]	// [x29+24]=6
  40055c:	b9401ba1 	ldr	w1, [x29, #24]	// w1=6
  400560:	b9401fa0 	ldr	w0, [x29, #28]	// w0=5
  400564:	97ffffee 	bl	40051c <add>
  400568:	52800000 	mov	w0, #0x0                   	// #0
  40056c:	a8c27bfd 	ldp	x29, x30, [sp], #32
  400570:	d65f03c0 	ret
  400574:	00000000 	.inst	0x00000000 ; undefined

#endif
